package com.lawrence.controller;

import io.swagger.annotations.Api;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 拦截器练习
 * @author wanglanglang
 */
@RestController
@Api(tags = "拦截器练习")
public class InterceptorController {

    /**
     * 访问此请求的地址是localhost:8080/interceptor
     * @param pageindex
     * @param map
     */
    @GetMapping("/insert")
    public void interceptorTest(@RequestParam(defaultValue = "1") Integer pageindex, ModelMap map){
        System.out.println("没有被拦截...");
    }

    /**
     * 访问此请求的地址是localhost:8080/test
     */
    @GetMapping("/insert2")
    public void interceptorTest(){
        System.out.println("被拦截了...");
    }
}
